﻿using SqlSugar;

namespace Zhaoxi.App.Common.Entity
{
    [SugarTable("Role")]// 
    public class Role
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(ColumnName = "RoleName", IsNullable = true)]
        public string? RoleName { get; set; }

        [SugarColumn(ColumnName = "CreateTime", IsNullable = true)]
        public DateTime? CreateTime { get; set; }

        [Navigate(typeof(UserRoleMapping), nameof(UserRoleMapping.RoleId), nameof(UserRoleMapping.UserId))]//注意顺序
        public List<User>? UserList { get; set; } //不能赋值只能是null
    }
}